{extend name="public:base" /}
{block name="theme"}转介绍管理{/block}
{block name="small_theme"}公司部门列表{/block}
{block name="breadcrumb"}
<li><a href="{:url('olist')}">公司部门列表</a></li>
<li class="active">业务首页</li>
{/block}
{block name="content"}
<!--<link rel="stylesheet" href="__CSS__/style.css">-->
<link rel="stylesheet" href="__CSS__/indexcommon.css">
<!--<section class="content" style="min-height: 60px;font-size: 14px;">-->
    <!--<form method="post" action="{:url('index')}" >-->
        <!--<div class="box_">-->
            <!--<div class="box_left">-->
                <!--<div class="form-group leibei">-->
                    <!--<label>关键词</label>-->
                    <!--<input type="text" name="keyword" value="{$keyword}" placeholder="手机或者姓名" class="form-control">-->
                <!--</div>-->
                <!--<div class="form-group leibei">-->
                    <!--<label>部门</label>-->
                    <!--<select class="form-control" name="bumen">-->
                        <!--<option value="0" >全部</option>-->
                        <!--{volist name="depar" id="data"}-->
                            <!--<option value="{$data.id}" {eq name="bumen" value="$data.id"}  selected="selected"{/eq}>{$data.sectionname}</option>-->
                        <!--{/volist}-->
                    <!--</select>-->
                <!--</div>-->
                <!--<div style="margin-left: 20px;">-->
                    <!--<button class="btn btn-primary">开始查询</button>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
    <!--</form>-->
<!--</section>-->
<!-- 查询结束 -->
<!-- 列表开始 -->
<div class="row">
    <div class="col-xs-12">
        <div class="box box-list">
            <div class="box-header" data-original-title="" style="height: 40px;">
                <a href="javascript:openadd();"  class="btn"><h2 style="margin-top: 0;"><i class="glyphicon glyphicon-plus"></i> 增加部门</h2></a>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding" style="border-bottom: 1px solid #dfdfdf;overflow: hidden;">
                <table class="table table-striped table-bordered table-condensed">
                    <tr>
                        <th>ID</th>
                        <th>部门名称</th>
                        <th>操作</th>
                    </tr>
                    {volist name='depardata' id="v" }
                    <tr>
                        <td>{$v.id}</td>
                        <td>{$v._name}</td>
                        <td>
                            <a href="javascript:openadd('{:url('add',['id'=>$v['id']])}');">添加子部门</a> |
                            <a class="" href="javascript:openedit('{:url('edit',['id'=>$v['id']])}');">编辑</a> |
                            <a class="" href="javascript:opendel('{:url('del',['id'=>$v['id']])}');">删除</a>
                        </td>
                    </tr>
                    {/volist}

                </table>
            </div>
            <!-- /.box-body -->
            <div class="page">{$page}</div>
        </div>
        <!-- /.box -->
    </div>
</div>
<!-- 列表结束 -->
</div>
{/block}
{block name="js"}
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
    //iframe层
    function openadd(url){
        var urls=url||"{:url('add')}";
        layer.open({
            type: 2,
            anim:6,
            skin: 'layui-layer-lan', //样式类名
            title: '添加部门',
            shadeClose: true,
            shade: 0.8,
            area: ['50%', '60%'],
            content: urls,
            end:function(){
                history.go(0);
            }
        });
    }
    function openedit(url){
        layer.open({
            type: 2,
            anim:6,
            title: '编辑部门',
            skin: 'layui-layer-lan', //样式类名
            shadeClose: true,
            shade: 0.8,
            area: ['50%', '60%'],
            content: url,
            end:function(){
                history.go(0);
            }
        });
    }
    function opendel(url){
        layer.confirm('确定删除？', {
            btn: ['删除','取消'] //按钮
        }, function(){
            $.post(url,function(data){
                layer.msg(data.msg, {
                    icon: data.code,
                    time:2000,
                },function(){
                    history.go(0);
                });
            });
        }, function(){
            layer.msg('下次不要这么调皮了', {
                icon: 2,
            });
        });
    }
    highlight_subnav("{:url('index')}");
</script>
{/block}
